import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code2 {
    public static int n,m;
    public static boolean[] vis = new boolean[11];
    public static int sum;//目前的和

    public static void dfs(int x) {
        if(sum==m) {
            for(int i=1;i<=n;i++) {
                if(vis[i]) {
                    System.out.print(i+" ");
                }
            }
            System.out.println();
            return;
        }
        if(x>n||sum>m) return;
        //选择
        sum+=x;
        vis[x]=true;
        dfs(x+1);
        sum-=x;
        vis[x]=false;
        //不选
        dfs(x+1);
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        dfs(1);
    }
}